<template>
  <el-row>
    <el-col :span="24" class="col-xs-12">
      <CompanyInfo :data="data"></CompanyInfo>

      <Portlet title="账号信息">
        <el-form label-position="left" label-width="110px">
          <el-row class="row">
            <el-col :lg="8" :md="12" :xl="6">
              <el-form-item label="账号姓名:">
                <span>{{ data.userName }}</span>
              </el-form-item>
            </el-col>
            <el-col :lg="8" :md="12" :xl="6">
              <el-form-item label-width="120px" label="绑定登录手机号:">
                <span>{{ data.userPhone }}</span>
              </el-form-item>
            </el-col>
            <el-col :lg="8" :md="12" :xl="6">
              <el-form-item label-width="120px" label="岗位账号:">
                <span>{{ data.position }}</span>
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>
        <div class="clearfix"></div>
      </Portlet>

      <Portlet title="业务模式">
        <el-form label-position="left" label-width="110px">
          <el-row>
            <el-col :lg="8" :md="12" :xl="6">
              <el-form-item label="业务模式:">
                <span>{{ data.businessModeCode | filterDataBaseDictionary }}</span>
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>
        <div class="clearfix"></div>
      </Portlet>

      <Portlet>
        <el-row class="row">
          <el-col :col="24" class="text-center">
            <el-button class="btn-block" @click.prevent="toEdit" type="primary">修改</el-button>
          </el-col>
        </el-row>
      </Portlet>
    </el-col>
  </el-row>
</template>
<script>
import CompanyInfo from './CompanyInfo'

import {filterDataBaseDictionary} from '@/filters'
export default {
  name: 'WarehousingShow',
  components: {
    CompanyInfo
  },
  filters: {
    filterDataBaseDictionary
  },
  data() {
    return {
      id: this.$route.params.id,
      data: {}
    }
  },
  created() {
    this.getData()
  },
  computed: {},
  methods: {
    getData() {
      this.$ajax.get('/ms-warehouse-order/company/getCompanyById', {companyId: this.id}).then(response => {
        if (!response.data) {
          return
        }
        this.data = response.data || {}
      })
    },
    toEdit() {
      this.$router.push({path: '/ss-oms/basic-data/company/edit/' + this.id})
    }
  }
}
</script>
